<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
   div{
       width: 300px;
       height: 300px;
       /* border: 1px solid #000; */
       margin: 0 auto;
   }
   ul{
       display: none;
       width: 100%;
       height: 100%;
   }
   li{
       list-style: none;
       width: 50px;
       height: 33px;
       color: #000;
       text-align: center;
       line-height: 33px;
       border: 1px solid #000;
   }
   li:hover{
    background-color: aqua;
    color: #fff;
   }
   button{
       padding-top: 0;
       margin-left: 38px;
   }
    </style>
</head>
<body>
    <div>
        <button onclick="fl()">输入法</button>
     
            <ul>
                <li>五笔</li>
                <li>拼音</li>
                <li onclick="gb()">关闭</li>
            </ul>
       
    </div>
</body>
</html>
<script>
    var ul = document.querySelector('ul')
    function fl() {
       ul.style.display = 'block'
    }
    function gb() {
       ul.style.display = 'none'
    }
</script>